package jp.sourceforge.akjrcp.text_douga.wizards.exportimg;

import jp.sourceforge.akjrcp.text_douga.rcp.TextDougaView;

import org.eclipse.jface.wizard.Wizard;
import org.eclipse.ui.PlatformUI;

public class ExportImageWizard extends Wizard{

	
	@Override
	public boolean performFinish() {
		TextDougaView view=(TextDougaView) PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().findView(TextDougaView.ID);
		
		//change mode
		
		view.setExportType(TextDougaView.IMAGE_AUDIO);
		view.setExportMode(TextDougaView.MODE_VIDEO);
		String text="";		
		if(page1.getSize().length()>0){
			text+="#export_size="+page1.getSize();
		}else{
			text+="#export_size="+"640x480";
		}
		text+="\n";
		if(page1.getFps().length()>0){
			text+="#export_fps="+page1.getFps();
		}else{
			text+="#export_fps="+"29.97";
		}
		text+="\n";
		text+=";\n";
		text+=page1.getPath()+"\n";
		view.setText(text);
		return true;
	}
	VideoInputPage page1;
	SizeAndRate page2;
	public void addPages()
    {
		page1=new VideoInputPage("endroll.inputText");
		addPage(page1);
		
		//oneday support selectable
		//page2=new SizeAndRate("endroll.inputText");
		//addPage(page2);
    }
}
